<html>
    <head>
        
        <script language="javascript"  src="/java_scripts/jquery/jquery.js"></script>
        <script language="javascript"  src="/java_scripts/jqueryFileTree/jqueryFileTree.js"></script>
        <script language="javascript"  src="/java_scripts/base64/base64.js"></script>
        <script language="javascript"  src="/java_scripts/main.js"></script>
        <script language="javascript"  src="/java_scripts/jqueryContextMenu/jquery.contextMenu.js"></script>

        
        <link href="/css_styles/main.css" rel="stylesheet" type="text/css" media="screen" />
        <link href="/java_scripts/jqueryContextMenu/jquery.contextMenu.css" rel="stylesheet" type="text/css" media="screen" />
	<link href="/java_scripts/jqueryFileTree/jqueryFileTree.css" rel="stylesheet" type="text/css" media="screen" />


         <!-- YUI Standard reset and fonts -->
        <link rel="stylesheet" type="text/css" href="/yui/build/reset/reset.css">
        <link rel="stylesheet" type="text/css" href="/yui/build/fonts/fonts.css">
        <link rel="stylesheet" type="text/css" href="/yui/build/container/assets/skins/sam/container.css">
        <!-- YUI CSS for MenuBar -->
        <link rel="stylesheet" type="text/css" href="/yui/build/menu/assets/skins/sam/menu.css">
        <link rel="stylesheet" type="text/css" href="/css_styles/menubar.css">
        <!-- Page-specific styles -->
        
        <script type="text/javascript" src="/yui/build/utilities/utilities.js"></script>
        <script type="text/javascript" src="/yui/build/container/container.js"></script>
        <!-- Menu source file -->
        <script type="text/javascript" src="/yui/build/menu/menu.js"></script>
        <script type="text/javascript" src="/java_scripts/menubar.js"></script>
	
	<!-- Toolbar -->

	<script type="text/javascript" src="/var/www/java_scripts/jqueryUI/js/jquery-ui-1.8.12.custom.min.js"></script>
        <link href="/java_scripts/jqueryUI/css/smoothness/jquery-ui-1.8.12.custom.css" rel="stylesheet" type="text/css" media="screen" />

	<style type="text/css">	
		.fg-button { outline: 0; margin:0 4px 0 0; padding: .4em 1em; text-decoration:none !important; cursor:pointer; position: relative; text-align: center; zoom: 1; }
		.fg-button .ui-icon { position: absolute; top: 50%; margin-top: -8px; left: 50%; margin-left: -8px; }
		a.fg-button { float:left; }
	
	        /* remove extra button width in IE */
		button.fg-button { width:auto; overflow:visible; }
	
		.fg-button-icon-left { padding-left: 2.1em; }
		.fg-button-icon-right { padding-right: 2.1em; }
		.fg-button-icon-left .ui-icon { right: auto; left: .2em; margin-left: 0; }
		.fg-button-icon-right .ui-icon { left: auto; right: .2em; margin-left: 0; }
	        
                /* solo icon buttons must have block properties for the text-indent to work */ 
		.fg-button-icon-solo { display:block; width:8px; text-indent: -9999px; }	
	
		.fg-buttonset { float:left; }
		.fg-buttonset .fg-button { float: left; }
		.fg-buttonset-single .fg-button, 
		.fg-buttonset-multi .fg-button { margin-right: -1px;}
	
		.fg-toolbar { padding: .5em; margin: 0;  }
		.fg-toolbar .fg-buttonset { margin-right:1.5em; padding-left: 1px; }
		.fg-toolbar .fg-button { font-size: 1em;  }

	/*demo page css*/
		h2 { clear: both; padding-top:1.5em; margin-top:0; } 
		.strike { text-decoration: line-through; }
	</style>	
	<script>
		function newButtonPressed() {
			var fileName = prompt("Please enter file name", "");
			var filePath = "/" + parent.userScriptsFolder + "/" + fileName;
			var ext = fileName.split(".")[1];
			switch(ext)
			{
				case "py":
						language = "python";
						break;
				case "rb":
						language = "ruby";
						break;
				case "sh":
						language = "bash";
						break;
				case "pl":
						language = "perl";
						break;
				default:
						language = "bash";
						break;
			}
			createFile(filePath);
			fileSelected = filePath;
			document.getElementById("filetreeFrame").contentWindow.refreshFTree();
		}

		function saveButtonPressed()
		{
			writeToFile();
			document.getElementById("filetreeFrame").contentWindow.refreshFTree();
		}


		function executeButtonPressed()
		{
			var resultsLoc = $("#resultsFrame").contents().find("#results");
			$(resultsLoc).val("Please wait for a few seconds ...");
			executeFile();
			document.getElementById("filetreeFrame").contentWindow.refreshFTree();
		}
	</script>

    </head>
    <body class="yui-skin-sam">
		<!-- Toolbar -->
		<div class="fg-toolbar ui-widget-header ui-corner-all ui-helper-clearfix">
			<div class="fg-buttonset ui-helper-clearfix">
                                <a href="#" onClick="newButtonPressed()" class="fg-button
                                                   ui-state-default
                                                   fg-button-icon-left
                                                   ui-corner-all"
                                            title="New"><span class="ui-icon ui-icon-document"></span> New</a>
				<a href="#" class="fg-button 
                                                   ui-state-default 
                                                   fg-button-icon-left
                                                   ui-corner-all" 
                                            title="Open"><span class="ui-icon ui-icon-folder-open"></span> Open</a>
				<a href="#" onClick="saveButtonPressed()" class="fg-button 
                                                   ui-state-default 
                                                   fg-button-icon-left
                                                   ui-corner-all" 
                                            title="Save"><span class="ui-icon ui-icon-disk"></span> Save</a>
			</div>

                        <div class="fg-buttonset ui-helper-clearfix">
                                <a href="#" class="fg-button
                                                   ui-state-default
                                                   fg-button-icon-left
                                                   ui-corner-all"
                                            title="Revert"><span class="ui-icon ui-icon-arrowreturnthick-1-w"></span> Revert</a>
                                <a href="#" class="fg-button
                                                   ui-state-default
                                                   fg-button-icon-solo
                                                   ui-corner-all"
                                            title="Close"><span class="ui-icon ui-icon-close"></span> Close</a>
                        </div>

                        <div class="fg-buttonset ui-helper-clearfix">
						<a href="#" class="fg-button ui-state-default fg-button-icon-left ui-corner-all"><span class="ui-icon ui-icon-arrowthick-1-w"></span>Previous</a>
						<a href="#" class="fg-button ui-state-default fg-button-icon-right ui-corner-all"><span class="ui-icon ui-icon-arrowthick-1-e"></span>Next</a>
                        </div>

                        <div class="fg-buttonset ui-helper-clearfix">
                                <a href="#" class="fg-button
                                                   ui-state-default
                                                   fg-button-icon-left
                                                   ui-corner-all"
                                            title="Compile"><span class="ui-icon ui-icon-bullet"></span> Compile</a>
                                <a href="#" class="fg-button
                                                   ui-state-default
                                                   fg-button-icon-left
                                                   ui-corner-all"
                                            title="Build"><span class="ui-icon ui-icon-check"></span> Build</a>
                                <a href="#" onClick="parent.executeButtonPressed()" class="fg-button
                                                   ui-state-default
                                                   fg-button-icon-left
                                                   ui-corner-all"
                                            title="Execute"><span class="ui-icon ui-icon-play"></span> Execute</a>
                        </div>

                        <div class="fg-buttonset ui-helper-clearfix">
                                <a href="#" class="fg-button
                                                   ui-state-default
                                                   fg-button-icon-left
                                                   ui-corner-all"
                                            title="Find"><span class="ui-icon ui-icon-search"></span>Find</a>
                        </div>

                        <div class="fg-buttonset ui-helper-clearfix">
                                <a href="#" class="fg-button
                                                   ui-state-default
                                                   fg-button-icon-left
                                                   ui-corner-all"
                                            title="Jump To"><span class="ui-icon ui-icon-seek-next"></span> Jump To</a>
                        </div>

		</div>
                <!-- FileTree, Editor and Results Window iFrames -->
		<iframe id="filetreeFrame" src="/htmls/filetree.html" style="width:15%;height:65%" 
                                                   framespacing=no 
                                                   border="5" 
                                                   frameborder="1" 
                                                   marginwidth="0" 
                                                   marginheight="0"  
                                                   scrolling="auto">
                </iframe>
		<iframe id="answerFrame" src="/htmls/answer.html" style="height:65%; width:70%" 
                                                 framespacing=no 
                                                 border="5" 
                                                 frameborder="1" 
                                                 scrolling="auto">
                </iframe>
<!--		<iframe style="height:65%; width:10%" framespacing=no border="5" frameborder="1"></iframe> -->
		<iframe id="resultsFrame" src="/htmls/results.html" style="height:25%; width:100%" 
                                                  framespacing=no 
                                                  border="0" 
                                                  frameborder="0"  
                                                  marginwidth="0" 
                                                  marginheight="0"  
                                                  scrolling="auto">
                </iframe>
    </body> 
</html>
